package com.seepln;
/**
 * Created by
 *
 * @auth: liqy
 * on 2021/4/20 16:22.
 * desc:
 */

/**
 * @ClassName: DBType
 * @Description: TODO
 * @Author: liqy
 * @CreateDate: 2021/4/20 16:22
 * @UpdateUser: liqy
 * @UpdateDate: 2021/4/20  16:22
 * @UpdateRemark: update TODO
 * @Version: 1.0
 */
public enum DBType {
    MYSQL("mysql"), ORACLE("oracle"), POSTGRE("pg"), SQLSERVER("sqlserver");

    private String name;

    DBType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static DBType getDBType(String dbType) {
        switch (dbType) {
            case "mysql":
                return DBType.MYSQL;
            case "oracle":
                return DBType.ORACLE;
            case "pg":
                return DBType.POSTGRE;
            case "sqlserver":
                return DBType.SQLSERVER;
            default:
                throw new IllegalStateException("Unexpected value: " + dbType);
        }
    }
}
